package org.future.taskmonitor;


import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Metrics;
import org.future.task.core.monitor.Monitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MonitorImpl implements Monitor {

    Logger log = LoggerFactory.getLogger(this.getClass());

    @Override
    public void inc(String name, long l, String... tags) {
        Metrics.counter(name, "queueName", tags[0], "threadName", tags[1]).increment(Double.valueOf(String.valueOf(l)));
    }

    @Override
    public void val(String name, long l) {
        log.info("队列名:{},速度:{}条/s", name, l);
    }

    @Override
    public void reset() {
        Metrics.globalRegistry.clear();
    }
}
